﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>新增渠道</title>
    <link rel="stylesheet" href="../../assets/js/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../../assets/css/global.css" media="all">
    <link rel="stylesheet" href="../../assets/js/font-awesome/css/font-awesome.min.css">
</head>
<body>
    <div class="admin-main">
        <form class="layui-form" action="/api/wechat/qrchannel/save">

            <div class="layui-form-item">
                <label class="layui-form-label">公众号id</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="wid" name="wid" lay-verify="required" placeholder="公众号id" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">渠道名称</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="channelname" name="channelname" lay-verify="required" placeholder="渠道名称" />
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">关联活动ID</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="PrmId" name="PrmId" lay-verify="required" placeholder="关联活动ID" />
                </div>
            </div>


            <div class="layui-form-item">

                <label class="layui-form-label">渠道状态</label>

                <div class="layui-input-block">
                    <select bindattr="status" name="status" lay-verify="required">
                        <option value="-1">停用</option>
                        <option value="1">启用</option>
                    </select>
                    <b style="color:red">注意：如果本公众号渠道设置为启用，则同一公众号其他渠道会自动关闭</b>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">渠道类型</label>

                <div class="layui-input-block">
                    <select bindattr="channeltype" name="channeltype" lay-verify="required">
                        <option value="SendBook">实体礼物任务宝</option>
                        <option value="FreeTsg">电子书</option>
                    </select>

                </div>
            </div>



            <div class="layui-form-item">
                <label class="layui-form-label">海报背景图名称</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="BgFileName" name="BgFileName" lay-verify="required" placeholder="海报背景图名称" />
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">昵称x轴像素FontLeft</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" value="0" bindattr="FontLeft" name="FontLeft" lay-verify="required" placeholder="昵称x轴像素FontLeft" />
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">昵称y轴像素FontTop</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" value="0" bindattr="FontTop" name="FontTop" lay-verify="required" placeholder="昵称y轴像素FontTop" />
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">昵称字体大小FontSize</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" value="0" bindattr="FontSize" name="FontSize" lay-verify="required" placeholder="昵称字体大小FontSize" />
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">头像y轴像素HeaderTop</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="HeaderTop" name="HeaderTop" lay-verify="required" placeholder="头像y轴像素" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">头像x轴像素HeaderLeft</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="HeaderLeft" name="HeaderLeft" lay-verify="required" placeholder="头像x轴像素HeaderLeft" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">头像高度HeaderHeight</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="HeaderHeight" name="HeaderHeight" lay-verify="required" placeholder="头像高HeaderHeight" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">头像宽度HeaderWidth</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="HeaderWidth" name="HeaderWidth" lay-verify="required" placeholder="头像宽度HeaderWidth" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">二维码y轴像素QrTop</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="QrTop" name="QrTop" lay-verify="required" placeholder="二维码y轴像素QrTop" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">二维码x轴像素QrLeft</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="QrLeft" name="QrLeft" lay-verify="required" placeholder="二维码x轴像素QrLeft" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">二维码高度QrHeight</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="QrHeight" name="QrHeight" lay-verify="required" placeholder="二维码x轴像素QrLeft" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">二维码宽度QrWidth</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="QrWidth" name="QrWidth" lay-verify="required" placeholder="二维码宽度QrWidth" />
                </div>
            </div>




            <div class="layui-form-item">
                <label class="layui-form-label">生成海报前置提示语</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea" bindattr="PreMessage" id="PreMessage" name="PreMessage"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">下线新关注前置提示语</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea" bindattr="SubNotice" id="SubNotice" name="SubNotice"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">关注提醒上线提示语</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea" bindattr="TemplateNoticeContent" id="TemplateNoticeContent" name="TemplateNoticeContent"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">关注提醒上线消息模板id</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="NoticeLeaderTemplateId" name="NoticeLeaderTemplateId" lay-verify="required" placeholder="关注提醒上线消息模板id" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">关注提醒上线备用消息模板id</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="ReserveNoticeLeaderTemplateId" name="ReserveNoticeLeaderTemplateId" lay-verify="required" placeholder="关注提醒上线备用消息模板id" />
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">点开关注提醒上线消息模板链接</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="PrmUrl" name="PrmUrl" lay-verify="required" placeholder="点开关注提醒上线消息模板链接" />
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒标题</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Title" name="Title" placeholder="留空则不发客服消息" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒内容</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Description" name="Description" placeholder="新关注客服消息提醒内容" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒图片封面</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="PicUrl" name="PicUrl" placeholder="新关注客服消息提醒图片封面" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒点开链接</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Url" name="Url" placeholder="新关注客服消息提醒点开链接" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">延迟时间（单位:秒）</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Delay" name="Delay" placeholder="延迟时间（单位:秒）" />
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒标题1</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Title1" name="Title1" placeholder="留空则不发客服消息" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒内容1</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Description1" name="Description1" placeholder="新关注客服消息提醒内容" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒图片封面1</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="PicUrl1" name="PicUrl1" placeholder="新关注客服消息提醒图片封面" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒点开链接1</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Url1" name="Url1" placeholder="新关注客服消息提醒点开链接" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">延迟时间1（单位:秒）</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Delay1" name="Delay1" placeholder="延迟时间（单位:秒）" />
                </div>
            </div>



            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒标题2</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Title2" name="Title2" placeholder="留空则不发客服消息" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒内容2</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Description2" name="Description2" placeholder="新关注客服消息提醒内容" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒图片封面2</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="PicUrl2" name="PicUrl2" placeholder="新关注客服消息提醒图片封面" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒点开链接2</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Url2" name="Url2" placeholder="新关注客服消息提醒点开链接" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">延迟时间2（单位:秒）</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Delay2" name="Delay2" placeholder="延迟时间（单位:秒）" />
                </div>
            </div>



            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒标题3</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Title3" name="Title3" placeholder="留空则不发客服消息" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒内容3</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Description3" name="Description3" placeholder="新关注客服消息提醒内容" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒图片封面3</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="PicUrl3" name="PicUrl3" placeholder="新关注客服消息提醒图片封面" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新关注客服消息提醒点开链接3</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Url3" name="Url3" placeholder="新关注客服消息提醒点开链接" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">延迟时间3（单位:秒）</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" bindattr="Delay3" name="Delay3" placeholder="延迟时间（单位:秒）" />
                </div>
            </div>





            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="button" lay-submit="" lay-filter="save" class="layui-btn J_ajaxSubmit" value="保存" />
                    <input type="reset" class="layui-btn layui-btn-primary" value="重置" />
                </div>
            </div>
        </form>
    </div>
</body>

<script type="text/javascript" src="../../assets/js/layui/layui.js"></script>
<script type="text/javascript">
    layui.cache.page = 'promote';
    layui.config({
        version: "1.0.1",
        base: 'js/'
    }).use('promote');

    layui.use('laydate', function () {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#starttime', //指定元素
            type: "datetime"
        });
        laydate.render({
            elem: '#endtime', //指定元素
            type: "datetime"
        });
    });

    function onDataLoadedCallback(data) {



    }

    //赠送礼品数据
    function onBeforeSubmmit(data) {

        //渠道内容
        data.channelcontentModel = new Object();
        data.channelcontentModel.BgFileName = data.BgFileName;
        data.channelcontentModel.FontLeft = data.FontLeft;
        data.channelcontentModel.FontSize = data.FontSize;
        data.channelcontentModel.FontTop = data.FontTop;
        data.channelcontentModel.HeaderHeight = data.HeaderHeight;
        data.channelcontentModel.HeaderLeft = data.HeaderLeft;
        data.channelcontentModel.HeaderTop = data.HeaderTop;
        data.channelcontentModel.HeaderWidth = data.HeaderWidth;
        data.channelcontentModel.NoticeLeaderTemplateId = data.NoticeLeaderTemplateId;
        data.channelcontentModel.PreMessage = data.PreMessage;
        data.channelcontentModel.PrmId = data.PrmId;
        data.channelcontentModel.PrmUrl = data.PrmUrl;
        data.channelcontentModel.QrHeight = data.QrHeight;
        data.channelcontentModel.QrLeft = data.QrLeft;
        data.channelcontentModel.QrTop = data.QrTop;
        data.channelcontentModel.QrWidth = data.QrWidth;
        data.channelcontentModel.ReserveNoticeLeaderTemplateId = data.ReserveNoticeLeaderTemplateId;
        data.channelcontentModel.TemplateNoticeContent = data.TemplateNoticeContent;
        data.channelcontentModel.SubNotice = data.SubNotice;
        //客服消息
        if (data.Title != "") {
            data.newsArticleModel = new Array();
            var item = new Object();
            item.Description = data.Description;
            item.PicUrl = data.PicUrl;
            item.Title = data.Title;
            item.Url = data.Url;
            item.Delay =Number( data.Delay);
            data.newsArticleModel.push(item);
        }

        if (data.Title1 != "") {
            var item = new Object();
            item.Description = data.Description1;
            item.PicUrl = data.PicUrl1;
            item.Title = data.Title1;
            item.Url = data.Url1;
            item.Delay = Number(data.Delay1);
            data.newsArticleModel.push(item);
        }

        if (data.Title2 != "") {
            var item = new Object();
            item.Description = data.Description2;
            item.PicUrl = data.PicUrl2;
            item.Title = data.Title2;
            item.Url = data.Url2;
            item.Delay = Number(data.Delay2);
            data.newsArticleModel.push(item);
        }

        if (data.Title3 != "") {
            var item = new Object();
            item.Description = data.Description3;
            item.PicUrl = data.PicUrl3;
            item.Title = data.Title3;
            item.Url = data.Url3;
            item.Delay = Number(data.Delay3);
            data.newsArticleModel.push(item);
        }


        return data;

    }



</script>
</html>